package com.wmyg.antifake.fabric.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.wmyg.antifake.entity.Product;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author 王卓逸
 * @program TODO
 * @description TODO
 * @create 2019-05-12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductFabricDto {

    public ProductFabricDto(Product product, String productHash) {
        this.productId = product.getProductId();
        this.productName = product.getProductName();
        this.productSpecs = product.getProductSpecs();
        this.remarks = product.getRemarks();
        this.productLogo = product.getProductLogo();
        this.productPics = product.getProductPics();
        this.companyId = product.getCompany().getCompanyId();
        this.createTime = product.getCreateTime();
        this.modifyTime = product.getModifyTime();
        this.productHash = productHash;
    }

    @JSONField(name = "product_id")
    private String productId;

    @JSONField(name = "product_name")
    private String productName;

    @JSONField(name = "product_specs")
    private String productSpecs;

    @JSONField(name = "remarks")
    private String remarks;

    @JSONField(name = "product_logo")
    private String productLogo;

    @JSONField(name = "product_pics")
    private String productPics;

    @JSONField(name = "company_id")
    private Integer companyId;

    @JSONField(name = "create_time")
    private Date createTime;

    @JSONField(name = "modify_time")
    private Date modifyTime;

    @JSONField(name = "product_hash")
    private String productHash;

}
